﻿<!DOCTYPE html>
<!--[if IE]><![endif]-->
<html>
  
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Execute an ETL process </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Execute an ETL process ">
    <meta name="generator" content="docfx 2.40.1.0">
    
    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">
    
    
    
  </head>
  <body data-spy="scroll" data-target="#affix" data-offset="120">
    <div id="wrapper">
      <header>
        
        <nav id="autocollapse" class="navbar navbar-inverse ng-scope" role="navigation">
          <div class="container">
            <div class="navbar-header">
              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                <span class="sr-only">Toggle navigation</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
              </button>
              
              <a class="navbar-brand" href="../index.html">
                <img id="logo" class="svg" src="../images/logo.svg" alt="">
              </a>
            </div>
            <div class="collapse navbar-collapse" id="navbar">
              <form class="navbar-form navbar-right" role="search" id="search">
                <div class="form-group">
                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">
                </div>
              </form>
              <a class="navbar-brand" href="https://github.com/paillave/Etl.Net" style="float:right">
                <img id="logo" class="svg" src="../images/github.svg" style="height:52px">
              </a>
            </div>
          </div>
        </nav>
        
        <div class="subnav navbar navbar-default">
          <div class="container hide-when-search" id="breadcrumb">
            <ul class="breadcrumb">
              <li></li>
            </ul>
          </div>
        </div>
      </header>
      <div role="main" class="container body-content hide-when-search">
        
        <div class="sidenav hide-when-search">
          <a class="btn toc-toggle collapse" data-toggle="collapse" href="#sidetoggle" aria-expanded="false" aria-controls="sidetoggle">Show / Hide Table of Contents</a>
          <div class="sidetoggle collapse" id="sidetoggle">
            <div id="sidetoc"></div>
          </div>
        </div>
        <div class="article row grid-right">
          <div class="col-md-10">
            <article class="content wrap" id="_content" data-uid="">
<h1 id="execute-an-etl-process">Execute an ETL process</h1>

<h2 id="description">Description</h2>
<p>The execution of a job is an async task as it is made of threads that run in parallel to accomplish the process.</p>
<p>The class that is in charge of executing an ETL job is <code>Paillave.Etl.StreamProcessRunner</code>.</p>
<h2 id="source-code-example">Source code example</h2>
<p>This will run the ETL process defined in the recipe <a href="Define.Etl.Process.html#source-code-example">Define an Etl process</a></p>
<div class="tabGroup" id="tabgroup_CeZOj-G++Q">
<ul role="tablist">
<li role="presentation">
<a href="#tabpanel_CeZOj-G++Q_InlineCallExecution" role="tab" aria-controls="tabpanel_CeZOj-G++Q_InlineCallExecution" data-tab="InlineCallExecution" tabindex="0" aria-selected="true">Inline call execution</a>
</li>
<li role="presentation">
<a href="#tabpanel_CeZOj-G++Q_InstanceRunnerCreation" role="tab" aria-controls="tabpanel_CeZOj-G++Q_InstanceRunnerCreation" data-tab="InstanceRunnerCreation" tabindex="-1">Ask runner instance creation</a>
</li>
<li role="presentation">
<a href="#tabpanel_CeZOj-G++Q_CreateRunnerInstance" role="tab" aria-controls="tabpanel_CeZOj-G++Q_CreateRunnerInstance" data-tab="CreateRunnerInstance" tabindex="-1">Create runner instance</a>
</li>
</ul>
<section id="tabpanel_CeZOj-G++Q_InlineCallExecution" role="tabpanel" data-tab="InlineCallExecution">
<pre><code class="lang-csharp" name="Main">[TestMethod]
public void InlineMethodWay()
{
    var config = new SimpleConfigStreamType { Divider = 10 };
    var task = StreamProcessRunner.CreateAndExecuteAsync(config, SimpleJob.Job1);
    task.Wait();
    CollectionAssert.AreEquivalent(new[] { $&quot;{100 / 10} times hello world!&quot; }, config.Messages.ToArray());
}
</code></pre></section>
<section id="tabpanel_CeZOj-G++Q_InstanceRunnerCreation" role="tabpanel" data-tab="InstanceRunnerCreation" aria-hidden="true" hidden="hidden">
<pre><code class="lang-csharp" name="Main">[TestMethod]
public void StaticMethodWay()
{
    var runner = StreamProcessRunner.Create&lt;SimpleConfigStreamType&gt;(SimpleJob.Job1);
    var config = new SimpleConfigStreamType { Divider = 10 };
    var task = runner.ExecuteAsync(config);
    task.Wait();
    CollectionAssert.AreEquivalent(new[] { $&quot;{100 / 10} times hello world!&quot; }, config.Messages.ToArray());
}
</code></pre></section>
<section id="tabpanel_CeZOj-G++Q_CreateRunnerInstance" role="tabpanel" data-tab="CreateRunnerInstance" aria-hidden="true" hidden="hidden">
<pre><code class="lang-csharp" name="Main">[TestMethod]
public void InstanceMethodWay()
{
    var runner = new StreamProcessRunner&lt;SimpleConfigStreamType&gt;(SimpleJob.Job1);
    var config = new SimpleConfigStreamType { Divider = 10 };
    var task = runner.ExecuteAsync(config);
    task.Wait();
    CollectionAssert.AreEquivalent(new[] { $&quot;{100 / 10} times hello world!&quot; }, config.Messages.ToArray());
}
</code></pre></section>
</div>
</article>
          </div>
          
          <div class="hidden-sm col-md-2" role="complementary">
            <div class="sideaffix">
              <p><img src="../images/full-black-logo.svg" alt="Logo Etl.Net"></p>
              <div class="contribution">
                <ul class="nav">
                  <li>
                    <a href="https://github.com/paillave/Etl.Net/blob/rehandlereactive/docfx_project/recipes/Execute.Etl.Process.md/#L1" class="contribution-link">Improve this Doc</a>
                  </li>
                </ul>
              </div>
              <nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
              <!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
              </nav>
            </div>
          </div>
        </div>
      </div>
      
      <footer>
        <div class="grad-bottom"></div>
        <div class="footer">
          <div class="container">
            <span class="pull-right">
              <a href="#top">Back to top</a>
            </span>
            
            <span>Generated by <strong>DocFX</strong></span>
          </div>
        </div>
      </footer>
    </div>
    
    <script type="text/javascript" src="../styles/docfx.vendor.js"></script>
    <script type="text/javascript" src="../styles/docfx.js"></script>
    <script type="text/javascript" src="../styles/main.js"></script>
  </body>
</html>
